gpsbase = 'com11';
gpsagent= 'com8';


serialgpsbase=serial(gpsbase);                                     
set(serialgpsbase,'BaudRate',115200,'StopBits',1,'Parity','none','DataBits',8,'InputBufferSize',8000);
fopen(serialgpsbase);

serialgpsagent=serial(gpsagent);                                     
set(serialgpsagent,'BaudRate',115200,'StopBits',1,'Parity','none','DataBits',8,'InputBufferSize',8000);
fopen(serialgpsagent);

measurementLengthGPS =1000;
positions=zeros(measurementLengthGPS,3);
while(true)
    str1  = fscanf(serialgpsagent,'%s');
    a1    = sscanf(str1,'$GPYBM,SN%d,%f,%f,%f,%f');

end